<?php
include("../conn/conn.php");
header("content-type:text/html;charset=utf-8");
$name=$_POST[name];
$id=$_POST[id];
$sql="select * from tb_ydxt where people='$name'";
$result=mysqli_query($link,$sql);
if($vidoex=mysqli_fetch_assoc($result)){
	$na=$vidoex[name];
	$sql_x="update tb_room set state=0 where name='$na'";
	if(mysqli_query($link,$sql_x)){
		echo("<script>alert('操作成功！');window.location.href='ht.php';</script>");
		}else{
			echo("<script>alert('操作失败！');window.location.href='ld.php';</script>");
			}
	}
?>